<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <meta charset="UTF-8">
	<title>Document</title>
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport" id="viewport" />
	<script src="js/jquery.min.js"></script>
	<script src="js/lc_switch.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="css/index.css">
	<link rel="stylesheet" href="css/store-mana.css">
</head>
<body>
	<section>
		<div>
			<h5>全部店铺</h5>
			<ul>
				<c:forEach items="${list }" var="info">
					<li>${info.sellerName }  <input type="checkbox" name="check-3" value="${info.id}" class="lcs_check lcs_tt1" <c:if test="${info.sellerstatus == 1 }">checked="checked"</c:if>  /></li>
				</c:forEach>
			</ul>
		</div>
	</section>
	<script type="text/javascript">
$(document).ready(function(e) {
	$('input').lc_switch();
	// triggered each time a field changes status
	$('body').delegate('.lcs_check', 'lcs-statuschange', function() {
		var status = ($(this).is(':checked')) ? 'checked' : 'unchecked';
		var sellerId = $(this).val();
		var stat = 0;
		if(status == 'checked'){
			stat = 1;
		}else{
			stat = 0;
		}
		$.ajax({
            type: 'GET',
            url: 'seller/setStatus?status='+stat+'&id='+sellerId,
            dataType: 'json',
            success: function(data){
            	/* if(data.code == 1){
            		if(sStatus == 1){
            			$(".mstat").html("店铺营业中");
            		}else{
            			$(".mstat").html("暂停营业");
            		}
            		$(".do input ").toggleClass('ope-btn')
            	} */
            }
		})
	});

	// triggered each time a field is checked
	$('body').delegate('.lcs_check', 'lcs-on', function() {
		console.log('field is checked');
	});
	
	
	
});
</script> 
</body>
</html>
